package com.soshalboard.config;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.ResourceBundle;

public class DbToView {
	ArrayList<String> fileList = new ArrayList<String>();
	ArrayList<ResourceBundle> rbList = new ArrayList<ResourceBundle>();
	HashMap<String, Integer> fileMap = new HashMap<String,Integer>();
	
	public DbToView(String... files) {
		int flag = 0;
		for (String file : files) {
			rbList.add(ResourceBundle.getBundle(file));
			fileMap.put(file, flag);
			flag++;
		}
	}
	
	public String getViewValue(String propertyFile, String key) {
		ResourceBundle rb = rbList.get(fileMap.get(propertyFile));
		String value = rb.getString(key);
		return value;
	}
}